﻿using System;
using GalaSoft.MvvmLight;
using ProjectWizardManagement.Entity.Model;

namespace ProjectWizardManagementv1.ViewModels.Concrete
{
    public class TaskViewModel : ViewModelBase
    {
        #region Members
        private static int _idIncrement;
        #endregion

        #region Properties

        public int Id { get; private set; }

        public string Name
        {
            get { return Task.Name; }
            set { Task.Name = value; RaisePropertyChanged("Name"); }
        }

        public string Description
        {
            get { return Task.Description; }
            set { Task.Description = value; RaisePropertyChanged("Description"); }
        }

        public bool IsSendingNotificaiton
        {
            get { return Task.IsSendingNotification; }
            set { Task.IsSendingNotification = value; RaisePropertyChanged("IsSendingNotification"); }
        }

        public DateTime DueDate
        {
            get { return Task.DueDate; }
            set { Task.DueDate = value; RaisePropertyChanged("DueDate"); }
        }

        public string FilePath
        {
            get { return Task.FilePath; }
            set { Task.FilePath = value; RaisePropertyChanged("FilePath"); }
        }

        public Task Task { get; private set; }

        public bool IsSelected { get; set; }
        #endregion

        public TaskViewModel(Task task)
        {
            Task = task;
            this.Id = _idIncrement;
            _idIncrement++;
        }

        public override string ToString()
        {
            return string.Format("{0}     Due: {1}", Name, DueDate);
        }
    }
}
